//
//  FliterController.swift
//  泛型介绍
//
//  Created by 崔博 on 2017/7/13.
//  Copyright © 2017年 崔博. All rights reserved.
//  flter函数

import UIKit

class FliterController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        let cuiboshuai = [".cuiboshuai",".cuibohenshuai"]
        _ = getSwiftFiles(flies: cuiboshuai)
    }

    // 获得一个某个字符串的文件数组
    // 基本写法
    func getSwiftFiles(flies: [String]) -> [String] {
        var resulet: [String] = []
        for str in flies {
            if str.hasSuffix(".cuibo") {
                resulet.append(str)
            }
        }
        return resulet
    }
    
}
